function downapp(){
        var server = document.location.hostname;
        var url;
        var browserType = getBrowserType();
        if(browserType=="weixin")
		{
        	$('.m-tc').show();
			return;
		}
		else if(browserType=="iphone")
		{
			url="https://lnk0.com/MZtMV1?chn=adwo";
		}
		else
		{
			url="http://up.apk.3z.cc/web/tttj/tttj200_xiaoshuo.apk"; 
		}
//        alert(url);return;
        window.location.href = url;

}

function getBrowserType(){
	var useragent = navigator.userAgent.toLowerCase();
	var browserType;
	if(useragent.match(/MicroMessenger/i) && useragent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/i)){
		return browserType = "weixin";
	}else if(useragent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/i)){
		return browserType = "iphone";
	}else if(useragent.match(/android/i)){
		return browserType = "android";
	}else{
		return browserType = "pc";
	}
}
